﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using YAPL.Configuration;
using YAPL.Language.Compiler.CodeGen.ReflectionEmitGenerator;
using Ast = YAPL.Language.Ast;
using YAPL.Util;
namespace YAPL.Language.Compiler.CodeGen {
	public static class CodeGeneratorFactory {
		public static CodeGenerator CreateCodeGenerator(OutputInfo outputInfo) {
			//TODO change logic if something except ReCodeGenerator will appear
			var config = Config.Instance;
			var assemblyPath = config.GetString(Config.GENERATOR_ASSEMBLY_PATH);
			var typeName = config.GetString(Config.GENERATOR_TYPE_NAME);
			return TypeHelper.CreateType<CodeGenerator>(assemblyPath, typeName, outputInfo);
		}
	}
}
